home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / diverses / cexpress / keyboard / insdown.asm < prev    next >
Encoding:
Assembly Source File  |  1989-05-03  |  562 b   |  26 lines

  1. ;unsigned short  ins_key_down();
  2.  
  3.     EXTRN  _memory_model:byte
  4.  
  5. _TEXT    SEGMENT BYTE PUBLIC 'CODE'
  6.     ASSUME CS:_TEXT
  7.     PUBLIC _ins_key_down
  8. _ins_key_down proc near
  9.     push si            ;
  10.     sub  ax,ax        ;clear AX
  11.     mov  es,ax        ;point ES to 0000:0000
  12.     mov  si,418H        ;offset of status byte
  13.     mov  bl,128        ;test bit 7
  14.     mov  ax,1        ;TRUE value
  15.     test es:[si],bl        ;test the bit
  16.     jnz  L1            ;jump if TRUE
  17.     mov  ax,0        ;FALSE value
  18. L1:    pop  si            ;
  19.     cmp  _memory_model,0    ;quit
  20.     jle  quit        ;
  21.     db   0CBh        ;RET far
  22. quit:    ret            ;RET near
  23. _ins_key_down ENDP
  24. _TEXT    ENDS
  25.     END
  26.